package cn.cttic.app.api.controller;

import cn.cttic.app.api.domain.bo.DoInstallActionBo;
import cn.cttic.app.api.domain.bo.DoRemoveActionBo;
import cn.cttic.app.api.domain.bo.InstallOrderActionBaseBo;
import cn.cttic.app.api.domain.bo.InstallOrderQueryBo;
import cn.cttic.app.api.domain.vo.*;
import cn.cttic.app.api.enums.InstallOrderStatus;
import cn.cttic.base.api.domain.vo.BaseProductVo;
import cn.cttic.common.satoken.model.AppLoginUser;
import cn.cttic.common.satoken.utils.AppLoginHelper;
import cn.cttic.order.api.domain.BaseInstallOrder;
import cn.cttic.order.api.domain.bo.BaseInstallOrderBo;
import cn.cttic.order.api.domain.vo.BaseInstallOrderProcessVo;
import cn.cttic.order.api.domain.vo.BaseInstallOrderVo;
import cn.cttic.order.api.domain.vo.BaseSaleOrderVo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import cn.cttic.app.mapper.BaseInstallOrderMapper;
import cn.cttic.app.service.*;
import cn.cttic.common.core.domain.R;
import cn.cttic.common.core.utils.BeanCopyUtils;
import cn.cttic.common.mybatis.core.page.TableDataInfo;
import cn.cttic.resource.api.RemoteFileService;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;

/**
 * 移动端 - 安装接口
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/mini/install")
@Slf4j
public class AppInstallController {

    private final IBaseInstallOrderService installOrderService;

    private final IBaseSaleOrderService saleOrderService;

    private final IBaseProductService productService;

    private final BaseInstallOrderMapper installOrderMapper;

    private final IAppInstallService appInstallService;

    private final IAppSaleService appSaleService;

    @DubboReference
    private RemoteFileService remoteFileService;

    /**
     * 获取安装订单统计数据
     */
    @PostMapping("/getInstallOrderStatistic")
    public R<?> getInstallOrderStatistic() {

        // 获取登录用户
        AppLoginUser loginUser = AppLoginHelper.getAppLoginUser();

        try {

            List<BaseInstallOrder> saleOrderList = installOrderMapper.selectList(
                new LambdaUpdateWrapper<BaseInstallOrder>()
                    .eq(BaseInstallOrder::getInstallManId, loginUser.getUserId())
            );

            Map<Integer, List<BaseInstallOrder>> s = saleOrderList.stream().collect(Collectors.groupingBy(BaseInstallOrder::getStatus));
            Map<Integer, Integer> statisMap = new HashMap<>();

            for (InstallOrderStatus sos : InstallOrderStatus.values()) {
                if (s.containsKey(sos.getValue())) {
                    statisMap.put(sos.getValue(), s.get(sos.getValue()).size());
                } else {
                    statisMap.put(sos.getValue(), 0);
                }
            }

            return R.ok(statisMap);

        } catch (Exception e) {
            return R.fail("获取安装订单统计数据");
        }
    }

    /**
     * 创建安装单
     */
    @PostMapping("/createInstallOrder")
    public R<?> createInstallOrder() {

        // 获取登录用户
        AppLoginUser loginUser = AppLoginHelper.getAppLoginUser();

        try {

            List<BaseInstallOrder> saleOrderList = installOrderMapper.selectList(
                new LambdaUpdateWrapper<BaseInstallOrder>()
                    .eq(BaseInstallOrder::getInstallManId, loginUser.getUserId())
            );

            Map<Integer, List<BaseInstallOrder>> s = saleOrderList.stream().collect(Collectors.groupingBy(BaseInstallOrder::getStatus));
            Map<Integer, Integer> statisMap = new HashMap<>();

            for (InstallOrderStatus sos : InstallOrderStatus.values()) {
                if (s.containsKey(sos.getValue())) {
                    statisMap.put(sos.getValue(), s.get(sos.getValue()).size());
                } else {
                    statisMap.put(sos.getValue(), 0);
                }
            }

            return R.ok(statisMap);

        } catch (Exception e) {
            return R.fail("获取安装订单统计数据");
        }
    }

    /**
     * 加密手机号
     *
     * @param phone
     * @return
     */
    private String encryptPhone(String phone) {
        return phone.substring(0, 3) + "****" + phone.substring(phone.length() - 3);
    }

    /**
     * 根据安装码查询销售（安装）单（匿名访问）
     *
     * @param carNo 车牌号
     * @return
     */
    @GetMapping("/getSaleOrderByInstallCode")
    public R<?> getSaleOrderByInstallCode(@RequestParam(value = "installCode", required = true) String installCode) {

        BaseInstallOrderBo queryBo = new BaseInstallOrderBo();
        queryBo.setInstallCode(installCode);
        queryBo.setStatus(InstallOrderStatus.WAITING.getValue());

        List<BaseInstallOrderVo> installOrderVoList = installOrderService.queryList(queryBo);
        if (CollUtil.isEmpty(installOrderVoList)) {
            return R.fail("无效安装码");
        }
        BaseInstallOrderVo installOrderVo = CollUtil.getFirst(installOrderVoList);

        BaseSaleOrderVo saleOrderVo = saleOrderService.queryById(installOrderVo.getSaleOrderId());
        BaseProductVo productVo = productService.queryById(saleOrderVo.getProductId());
        if (saleOrderVo == null) {
            return R.fail("未找到安装信息");
        } else {
            AnnoSaleOrderVo annoSaleOrderVo = BeanCopyUtils.copy(saleOrderVo, AnnoSaleOrderVo.class);
            annoSaleOrderVo.setPhoneEncrypted(encryptPhone(saleOrderVo.getPhone()));
            annoSaleOrderVo.setInstallCode(installCode);
            annoSaleOrderVo.setProductName(productVo.getProductName());
            return R.ok(annoSaleOrderVo);
        }
    }

    /**
     * 根据车牌号查询安装单
     *
     * @param carNo 车牌号
     * @return
     */
    @GetMapping("/getInstallOrderByCarNo")
    public R<?> getInstallOrderByCarNo(@RequestParam(value = "carNo", required = true) String carNo) {

        try {
            List<BaseInstallOrderVo> baseInstallOrderVo = appInstallService.getInstallOrderByCarNo(carNo);
            if (baseInstallOrderVo != null) {
                return R.ok(baseInstallOrderVo);
            } else {
                return R.fail("未找到安装单");
            }
        } catch (Exception e) {
            return R.fail(e.getMessage());
        }

    }

    /**
     * 根据安装码查询安装单
     *
     * @param installCode 安装码
     * @return
     */
    @GetMapping("/getInstallOrderByInstallCode")
    public R<?> getInstallOrderByInstallCode(@RequestParam(value = "installCode", required = true) String installCode) {

        try {
            List<BaseInstallOrderVo>  baseInstallOrderVo = appInstallService.getInstallOrderByInstallCode(installCode);
            if (baseInstallOrderVo != null) {
                return R.ok(baseInstallOrderVo);
            } else {
                return R.fail("未找到安装单");
            }
        } catch (Exception e) {
            return R.fail(e.getMessage());
        }

    }


    /**
     * 获取正在安装的安装单
     *
     * @param installCode 安装码
     * @return
     */
    @GetMapping("/getInstallingOrder")
    public R<?> getInstallingOrder() {
        AppLoginUser appLoginUser = AppLoginHelper.getAppLoginUser();
        BaseInstallOrderVo baseInstallOrderVo = appInstallService.getInstallingOrder(appLoginUser.getUserId());
        if (baseInstallOrderVo != null) {
            BaseSaleOrderVo saleOrderVo = saleOrderService.queryById(baseInstallOrderVo.getSaleOrderId());
            baseInstallOrderVo.setSaleOrderVo(saleOrderVo);
            BaseProductVo baseProductVo = productService.queryById(saleOrderVo.getProductId());
            String productPosterUrl = remoteFileService.selectUrlByIds(baseProductVo.getProductPoster());
            baseProductVo.setProductPosterUrl(productPosterUrl);
            String productThumbnailUrl = remoteFileService.selectUrlByIds(baseProductVo.getProductThumbnail());
            baseProductVo.setProductThumbnailUrl(productThumbnailUrl);
            baseInstallOrderVo.setProductThumbnailUrl(productThumbnailUrl);
            saleOrderVo.setProductInfo(baseProductVo);
            return R.ok(baseInstallOrderVo);
        } else {
            return R.fail("无此类安装单");
        }
    }


    /**
     * 根据安装码查询安装单
     *
     * @param bo 安装码
     * @return
     */
    @GetMapping("/getInstallOrderPageList")
    public TableDataInfo getInstallOrderPageList(@Validated InstallOrderQueryBo bo) {

        // 获取登录用户
        AppLoginUser loginUser = AppLoginHelper.getAppLoginUser();

        try {
            TableDataInfo<BaseInstallOrderVo> productVoList = appInstallService.getInstallOrderPageList(bo);
            List<BaseInstallOrderVo> productVos = productVoList.getRows();
            productVos.forEach(vo -> {
                vo.setStatus(vo.getStatus());
                BaseSaleOrderVo saleOrderVo = saleOrderService.queryById(vo.getSaleOrderId());
                vo.setSaleOrderVo(saleOrderVo);
                BaseProductVo baseProductVo = productService.queryById(saleOrderVo.getProductId());
                String productPosterUrl = remoteFileService.selectUrlByIds(baseProductVo.getProductPoster());
                baseProductVo.setProductPosterUrl(productPosterUrl);
                String productThumbnailUrl = remoteFileService.selectUrlByIds(baseProductVo.getProductThumbnail());
                baseProductVo.setProductThumbnailUrl(productThumbnailUrl);
                vo.setProductThumbnailUrl(productThumbnailUrl);
                saleOrderVo.setProductInfo(baseProductVo);
            });
            productVoList.setRows(productVos);

            return productVoList;

        } catch (Exception e) {
            e.printStackTrace();
            return TableDataInfo.build();
        }
    }

    /**
     * 查询安装单详情
     *
     * @param id 安装单ID
     * @return
     */
    @GetMapping("/getInstallOrderDetail")
    R<InstallOrderProcessListVo> getInstallOrderDetail(@RequestParam(value = "id") String id) {

        try {
            InstallOrderProcessListVo vo = new InstallOrderProcessListVo();
            BaseInstallOrderVo installOrderVo = installOrderService.queryById(id);

            List<BaseInstallOrderProcessVo> resultList = appInstallService.getInstallOrderProcessList(id);
            vo.setProcessList(resultList);
            vo.setOrderId(installOrderVo.getId());
            vo.setSaleOrderId(installOrderVo.getSaleOrderId());

            return R.ok(vo);
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 获取安装订单公共详情
     *
     * @param jumpUrl 跳转地址
     * @return
     */
    @GetMapping("/getInstallOrderPublicDetail")
    public R<InstallOrderPublicDetailVo> getInstallOrderPublicDetail(@RequestParam(value = "jumpUrl", required = true) String jumpUrl) {

        try {

            InstallOrderPublicDetailVo detailVo = appInstallService.getInstallOrderPublicDetail(jumpUrl);

            return R.ok(detailVo);

        } catch (Exception e) {
            e.printStackTrace();
            return R.fail("获取安装订单公共详情失败");
        }

    }

    /**
     * 开始安装
     *
     * @param id 安装单ID
     * @return
     */
    @PostMapping("/startInstall")
    public R<?> startInstall(@RequestBody InstallOrderActionBaseBo queryBo) {
        try {
            AppLoginUser appLoginUser = AppLoginHelper.getAppLoginUser();

            BaseInstallOrderVo installOrderVo = appInstallService.startInstall(queryBo.getOrderId(), appLoginUser.getUserId());
            if (installOrderVo == null) {
                return R.fail("开始安装失败");
            } else {
                return R.ok(installOrderVo);
            }
        } catch (Exception e) {
            return R.fail(e.getMessage());
        }
    }

    /**
     * 提交安装
     *
     * @param id 安装单ID
     * @return
     */
    @PostMapping("/submitInstall")
    public R<?> submitInstall(@RequestBody InstallOrderActionBaseBo queryBo) {
        try {
            AppLoginUser appLoginUser = AppLoginHelper.getAppLoginUser();

            BaseInstallOrderVo installOrderVo = appInstallService.submitInstall(queryBo.getOrderId(), appLoginUser.getUserId());
            if (installOrderVo == null) {
                return R.fail("提交安装失败");
            } else {
                return R.ok(installOrderVo);
            }
        } catch (Exception e) {
            return R.fail(e.getMessage());
        }
    }

    /**
     * 车牌识别
     *
     * @return
     */
    @PostMapping("/doCarNoOcr")
    public R<?> NoOcr(@RequestPart("file") MultipartFile file) {
        try {
            String result = appInstallService.baiduCarNoOcr(file);
            log.info("车牌识别结果 {}", result);
            String encodedResult = URLEncoder.encode(result, "utf-8");
            log.info("车牌识别结果ENCODED {}", encodedResult);
            if (result == null) {
                return R.fail("车牌识别失败");
            } else {
                return R.ok("识别成功", encodedResult);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return R.fail(e.getMessage());
        }
    }

    /**
     * @return
     */
    @PostMapping("/doInstallAction")
    public R<?> doInstallAction(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessVo vo = appInstallService.BasedoInstallAction(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 检查并绑定设备
     *
     * @param imeiCode IMEI 号码
     * @return 检查绑定是否成功
     */
    @PostMapping("/checkAndBindDevice")
    R<Boolean> checkAndBindDevice(@Valid DoInstallActionBo installActionBo) {
        boolean r = appInstallService.checkAndBindDevice(installActionBo.getParam(), installActionBo);
        if (r) {
            return R.ok(true);
        } else {
            return R.fail();
        }
    }

    /**
     * 检查设备IMEI号是否存在
     *
     * @param imeiCode IMEI 号码
     * @return 检查绑定是否成功
     */
    @GetMapping("/checkIfDeviceBinded")
    R<Integer> checkIfDeviceBinded(@Valid InstallOrderActionBaseBo queryBo) {
        try {
            boolean r = appInstallService.checkIfDeviceBinded(queryBo.getOrderId());
            if (r) {
                return R.ok(1);
            } else {
                return R.ok(0);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 上传行驶证主页
     *
     * @param files           行驶证副页图片列表
     * @param installActionBo 上传行驶证主页参数
     * @return
     */
    @PostMapping("/addVehicleLicenseMainPage")
    R<BaseInstallOrderProcessUploadVo> addVehicleLicenseMainPage(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessUploadVo vo = appInstallService.addVehicleLicenseMainPage(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 移除行驶证主页
     *
     * @param files           行驶证副页图片列表
     * @param installActionBo 上传行驶证主页参数
     * @return
     */
    @PostMapping("/removeVehicleLicenseMainPage")
    R<BaseInstallOrderProcessVo> removeVehicleLicenseMainPage(@Valid @RequestBody DoRemoveActionBo removeActionBo) {
        try {
            BaseInstallOrderProcessVo r = appInstallService.removeVehicleLicenseMainPage(removeActionBo.getProcessId(), removeActionBo.getOssId(), removeActionBo.getOssUrl());
            if (ObjectUtil.isEmpty(r)) {
                return R.fail();
            } else {
                return R.ok(r);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }


    /**
     * 上传行驶证副页
     *
     * @param files           行驶证副页图片列表
     * @param installActionBo 上传行驶证副页参数
     * @return
     */
    @PostMapping("/uploadVehicleLcenseSubPage")
    R<BaseInstallOrderProcessVo> uploadVehicleLcenseSubPage(@RequestPart("files") MultipartFile[] files, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessVo vo = appInstallService.uploadVehicleLicenseMainPage(Arrays.stream(files).collect(Collectors.toList()), installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }


    /**
     * 上传行驶证副页
     *
     * @param files           行驶证副页图片列表
     * @param installActionBo 上传行驶证副页参数
     * @return
     */
    @PostMapping("/addVehicleLcenseSubPage")
    R<BaseInstallOrderProcessUploadVo> addVehicleLcenseSubPage(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessUploadVo vo = appInstallService.addVehicleLicenseMainPage(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 移除行驶证副页
     *
     * @param files           行驶证副页图片列表
     * @param installActionBo 上传行驶证主页参数
     * @return
     */
    @PostMapping("/removeVehicleLcenseSubPage")
    R<BaseInstallOrderProcessVo> removeVehicleLcenseSubPage(@Valid @RequestBody DoRemoveActionBo installActionBo) {
        try {
            BaseInstallOrderProcessVo r = appInstallService.removeVehicleLcenseSubPage(installActionBo.getProcessId(), installActionBo.getOssId(), installActionBo.getOssUrl());
            if (ObjectUtil.isEmpty(r)) {
                return R.fail();
            } else {
                return R.ok(r);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 上传车身照片
     *
     * @param file            车身照片
     * @param installActionBo 上传车身照参数
     * @return
     */
    @PostMapping("/uploadCarPhotoForCarNo")
    R<BaseInstallOrderProcessUploadVo> uploadCarPhotoForCarNo(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessUploadVo vo = appInstallService.uploadCarPhotoForCarNo(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }


    /**
     * 上传安装前接线处照片
     *
     * @param file            安装前接线处照片
     * @param installActionBo 上传安装前接线处照片参数
     * @return
     */
    @PostMapping("/uploadBeforeInstallConnectionPointPhoto")
    R<BaseInstallOrderProcessUploadVo> uploadBeforeInstallConnectionPointPhoto(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessUploadVo vo = appInstallService.uploadBeforeInstallConnectionPointPhoto(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }


    /**
     * 上传安装后接线处照片
     *
     * @param file            安装后接线处照片
     * @param installActionBo 上传安装后接线处照片参数
     * @return
     */
    @PostMapping("/uploadAfterInstallConnectionPointPhoto")
    R<BaseInstallOrderProcessUploadVo> uploadAfterInstallConnectionPointPhoto(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessUploadVo vo = appInstallService.uploadAfterInstallConnectionPointPhoto(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }


    /**
     * 上传安装位置照片
     *
     * @param file            安装位置照片
     * @param installActionBo 上传安装位置照片参数
     * @return
     */
    @PostMapping("/uploadInstallPostionPhoto")
    R<BaseInstallOrderProcessUploadVo> uploadInstallPostionPhoto(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessUploadVo vo = appInstallService.uploadInstallPostionPhoto(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }


    /**
     * 上传里程表照片
     *
     * @param file            里程表照片
     * @param installActionBo 上传里程表照片参数
     * @return
     */
    @PostMapping("/uploadOdometerPhoto")
    R<BaseInstallOrderProcessUploadVo> uploadOdometerPhoto(@RequestPart("file") MultipartFile file, @Valid DoInstallActionBo installActionBo) {
        try {
            BaseInstallOrderProcessUploadVo vo = appInstallService.uploadOdometerPhoto(file, installActionBo);
            if (vo == null) {
                return R.fail();
            } else {
                return R.ok(vo);
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }


    /**
     * 检查设备安装信息
     *
     * @param installActionBo 设备激活参数
     * @return
     */
    @PostMapping("/checkDeviceInstallInfo")
    R<InstallCheckResultVo> checkDeviceInstallInfo(@Valid DoInstallActionBo installActionBo) {
        try {
            InstallCheckResultVo r = appInstallService.checkDeviceInstallInfo(installActionBo);
            if (ObjectUtil.isNotEmpty(r)) {
                return R.ok(r);
            } else {
                return R.fail();
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 检查设备激活信息
     *
     * @param installActionBo 设备激活参数
     * @return
     */
    @PostMapping("/checkDeviceActiveInfo")
    R<InstallActiveResultVo> checkDeviceActiveInfo(@Valid DoInstallActionBo installActionBo) {
        try {
            InstallActiveResultVo r = appInstallService.checkDeviceActiveInfo(installActionBo);
            if (ObjectUtil.isNotEmpty(r)) {
                return R.ok(r);
            } else {
                return R.fail();
            }
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * 获取安装单所有安装步骤列表
     *
     * @param installOrderActionBaseBo 查询参数
     * @return
     */
    @GetMapping("/getInstallOrderProcessList")
    R<List<BaseInstallOrderProcessVo>> getInstallOrderProcessList(@Valid InstallOrderActionBaseBo installOrderActionBaseBo) {

        try {

            List<BaseInstallOrderProcessVo> resultList = appInstallService.getInstallOrderProcessList(installOrderActionBaseBo.getOrderId());

            return R.ok(resultList);
        } catch (Exception ex) {
            return R.fail(ex.getMessage());
        }
    }

    /**
     * @return
     */
    @PostMapping("/doInstallActivateDetection")
    public R<?> doInstallActivateDetection(@RequestPart("file") MultipartFile file, @RequestBody JSONObject installActionBo) {

        return R.ok();
    }

    /**
     * @return
     */
    @PostMapping("/doInstallDeviceInfoFetch")
    public R<?> doInstallDeviceInfoFetch(@RequestPart("file") MultipartFile file, @RequestBody JSONObject installActionBo) {

        return R.ok();
    }

}
